package com.timesheet.service.employee;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import com.timesheet.server.common.models.CEmployee;
import com.timesheet.server.core.dao.BaseDao;
import com.timesheet.serverice.employee.interfaces.IEmployeeDao;
import com.timesheet.serverice.interfaces.employee.model.IEmployee;
import com.timesheet.service.employee.impl.dao.EmployeeDao;

public class Activator implements BundleActivator {

	private static BundleContext context;

	static BundleContext getContext() {
		return context;
	}

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext bundleContext) throws Exception {
		Activator.context = bundleContext;
		CEmployee emp = new CEmployee();
		emp.setName("Kavitha");
		IEmployeeDao empDao = new EmployeeDao();
		empDao.createEmployee(emp);
		
		System.out.println(empDao.getAllEmployees());
	
		
	}

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext bundleContext) throws Exception {
		Activator.context = null;
	}

}
